package com.voute.Model.Impl;


import com.voute.Api.DiscoveryServcie;
import com.voute.Model.Bean.DiscoveryBean;
import com.voute.Model.IDiscoveryModel;
import com.voute.Utils.PreferenceUtils;
import com.voute.Utils.ServiceFactory;

import java.util.HashMap;

import rx.Observable;

/**
 * 今日热门的实现Model
 * Created by liukanshan on 2016/12/8.
 */

public class DiscoveryImpl implements IDiscoveryModel {
    @Override
    public Observable<DiscoveryBean> getDiscoveryFeeds(String anchor) {
        HashMap<String,String> values=new HashMap<>();
        values.put("anchor",anchor);
        values.put("lat", PreferenceUtils.GetLatitude());
        values.put("lng",PreferenceUtils.GetLongtitude());
        return ServiceFactory.GetInstance().createService(DiscoveryServcie.class).getDiscoveryFeeds(values);
    }

    @Override
    public Observable<DiscoveryBean> getLocalFeeds(String anchor) {
        HashMap<String,String> values=new HashMap<>();
        values.put("anchor",anchor);
        values.put("lat", PreferenceUtils.GetLatitude());
        values.put("lng",PreferenceUtils.GetLongtitude());
        return ServiceFactory.GetInstance().createService(DiscoveryServcie.class).getLocalFeeds(values);
    }
}
